//package com.ld.security.auth.server.config;
//
//import com.ld.security.auth.server.base.authentication.FailureAuthenticationHandler;
//import com.ld.security.auth.server.base.authentication.SuccessAuthenticationHandler;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.authentication.AuthenticationManager;
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
//import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.builders.WebSecurity;
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.crypto.password.PasswordEncoder;
//
///**
// * Created by Mr.Yangxiufeng on 2017/12/27.
// * Time:16:42
// * ProjectName:Mirco-Service-Skeleton
// */
//@Configuration
//@EnableWebSecurity
//@EnableGlobalMethodSecurity(prePostEnabled = true)
//public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
//
//    @Autowired
//    private UserDetailsServiceImpl userDetailsService;
//
//    @Bean
//    public PasswordEncoder passwordEncoder() {
//        return new SimpPasswordEncoder();
//    }
//
//    @Override
//    @Bean
//    public AuthenticationManager authenticationManagerBean() throws Exception {
//        return super.authenticationManagerBean();
//    }
//
//    @Override
//    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
//        auth.userDetailsService(userDetailsService)
//                .passwordEncoder(passwordEncoder());
//    }
//
//    @Autowired
//    private FailureAuthenticationHandler failureAuthenticationHandler;
//    @Autowired
//    private SuccessAuthenticationHandler successAuthenticationHandler;
//
//
//
//    @Override
//    protected void configure(HttpSecurity http) throws Exception {
//        http
//                .authorizeRequests()
//                .anyRequest().fullyAuthenticated()
//                .antMatchers("/oauth/token").permitAll()
//                .and()
//                .csrf().disable();
//        //http.httpBasic()  //httpBasic 登录
//
//    }
//
//    @Override
//    public void configure(WebSecurity web) throws Exception {
//        web.ignoring().antMatchers("/auth/authUser/login","/vue/**","/websocket/**","/static/**","/upload/**","/css/**", "/js/**", "/plugins/**", "/favicon.ico","/swagger-ui.html","/swagger-resources/**","/webjars/**","/v2/**");
//    }
//
//}